package com.ruoyi.system.service;

import com.ruoyi.system.domain.RedisDataInfo;
import com.ruoyi.system.domain.RedisInfo;
import com.ruoyi.system.domain.RedisVo;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;

import java.util.List;

public interface ISysRedisService {

    public List<RedisInfo> getRedisList();

    public List<RedisVo> iniRedisList();

    public int addRedis(RedisInfo redisInfo);

    public void updateRedis(RedisInfo redisInfo);

    public void deleteRedis(String id);

    public LettuceConnectionFactory getNewFactory(RedisInfo redisInfo);

    public List<RedisVo> getDBList(RedisInfo redisInfo);

    /**
     * 获取RedisTemplate对象
     *
     * @param redisDataInfo 设置 redisID,dbID 即可
     * @return
     */
    public StringRedisTemplate getRedisTemplate(RedisDataInfo redisDataInfo);

    public RedisInfo getRedisInfo(String id);

    public boolean testConnect(StringRedisTemplate redisTemplate);

    public StringRedisTemplate getRedisTemplate(RedisInfo redisInfo, Integer dbId);
}
